Easy2Siksha.com
GNDU Queson Paper 2024
BA 5
th
Semester
COMPUTER SCIENCE
(Database Management System & Oracle)
Time Allowed 3 Hours Maximum Marks 75
Note:-Aempt FIVE quesons in all, selecng at least ONE queson from each secon. The
h queson may be aempted from any secon. All quesons carry equal marks.
SECTION-A
1.(i) Discuss the importance of logical data independence and physical data independence.
(ii) What are the responsibilies of the DBA and the database designers ?
(iii) Relaon, R, has aributes (A, B, C, D, E, F) the set of FD's is:
A -> C D -> E F -> B E -> A C -> E B -> D
Find candidate key of R and jusfy your choice.
2.(i) Describe the terms: Primary key, Candidate key. Foreign key and Super key.
(ii) Explain how cardinalies, roles, weak enes and weak relaons are represented in E-
R diagrams. Demonstrate the database design with E-R Model for taking example of
Student Management System.
SECTION-B
3. Dene the term normalizaon and its need. Explain INF, 2NF and 3NF with suitable
examples. Also discuss the problems associated with these normal forms.
Easy2Siksha.com
4. Explain various database models along with their advantages and disadvantages.
SECTION-C
5. Consider the following schemas:
Student (sid: Integer, Firstname: string, lastname: string, age: Integer)
(i) Explain the use of logical operators using some SQL queries.
(ii) List various aggregaon funcons. Write SQL queries to implement aggregate
funcons.
6. What do you understand by a query language? Name various query language based on
Tuple and domain calculus. What are the dierent types of JOINs in SQL?
Explain with example.
SECTION-D
7. List various Concurrency Control and Management Mechanisms used in DBMS. Explain
of 2PL protocol.
8. Write detailed notes on the following:
(Big data)
(ii) Database recovery mechanisms
(ij) NoSQL.
Easy2Siksha.com
GNDU Answer Paper 2024
BA 5
th
Semester
COMPUTER SCIENCE
(Database Management System & Oracle)
Time Allowed 3 Hours Maximum Marks 75
Note:-Aempt FIVE quesons in all, selecng at least ONE queson from each secon. The
h queson may be aempted from any secon. All quesons carry equal marks.
SECTION-A
1.(i) Discuss the importance of logical data independence and physical data independence.
(ii) What are the responsibilies of the DBA and the database designers ?
(iii) Relaon, R, has aributes (A, B, C, D, E, F) the set of FD's is:
A -> C D -> E F -> B E -> A C -> E B -> D
Find candidate key of R and jusfy your choice.
Ans: PART (i): Importance of Logical Data Independence and Physical Data Independence
󹻂 What is Data Independence?
Data independence means changing data structure or storage without aecng the rest of
the system. It’s one of the main goals of a database system.
In a database, we have dierent levels:
1. Physical level – how data is stored in memory (hard disk, SSD, etc.)
2. Logical level – what data is stored and how it is related
3. View level – what the user sees (tables, columns)
󹻂 1. Logical Data Independence
Easy2Siksha.com
Denion:
Logical data independence means that changes made to the logical structure of the
database do not aect the external or view level.
󹳴󹳵󹳶󹳷 Simple Example:
Lets say we have a database for a college. It has a table for students:
STUDENT (RollNo, Name, Department)
Now suppose we add a new column Email to this table:
STUDENT (RollNo, Name, Department, Email)
Now, this is a logical change (we changed the structure).
But the applicaon that shows only RollNo and Name to users should not be aected by this
change.
󷃆󽅕 So, this is an example of Logical Data Independence.
󷃆󼽢 Importance of Logical Data Independence:
Developers can update the database structure (like add or remove elds) without
aecng end-users.
Reduces cost and eort to maintain the system.
Makes the database exible and scalable.
󹻂 2. Physical Data Independence
Denion:
Physical data independence means changing how data is stored physically on the disk
without aecng the logical structure or applicaon layer.
󹳴󹳵󹳶󹳷 Simple Example:
Suppose currently the data is stored in:
Flat les
Now, the DBA (Database Administrator) decides to use:
B+ trees or hashing for beer speed.
This is a change in physical storage, but the structure (tables, columns, etc.) remains the
same.
󷃆󽅕 The users and applicaons don’t need to change anything.
󷃆󼽢 Importance of Physical Data Independence:
Easy2Siksha.com
Allows performance opmizaon without touching the applicaon code.
Reduces dependency on storage design.
Gives freedom to DBAs to tune storage techniques.
󹻀 Summary Table:
Type of Independence
Changes Allowed
What Remains Unaected
Logical
Table structure, relaonships
User views, applicaons
Physical
Storage method, indexing
Tables, columns, structure
PART (ii): Responsibilies of DBA and Database Designers
Now lets talk about two important roles in database management:
DBA – Database Administrator
Database Designer
They have dierent but equally important jobs.
󹻀 1. Responsibilies of Database Administrator (DBA)
The DBA is like the manager of the enre database system.
󷃆󼽢 Key Responsibilies:
1. Data Security
o Control who can access what data.
o Use passwords, roles, and permissions.
2. Backup and Recovery
o Take regular backups.
o Recover data if there's a crash or loss.
3. Performance Tuning
o Monitor slow queries.
o Use indexes, paroning to speed up performance.
Easy2Siksha.com
4. User Management
o Create user accounts.
o Assign roles and privileges.
5. Data Integrity
o Enforce constraints (e.g., NOT NULL, UNIQUE).
o Ensure that data is correct and consistent.
6. Installing and Upgrading the DBMS
o Install the soware.
o Apply updates and patches when needed.
7. Monitoring Storage
o Monitor how much space is being used.
o Make plans for future growth.
󹳴󹳵󹳶󹳷 Example:
If a company uses a database for employee records, the DBA ensures:
Only HR sta can access salary data.
If the server crashes, data can be restored.
Queries for searching employees run quickly.
󹻀 2. Responsibilies of Database Designers
The database designer is like the architect of the database system.
󷃆󼽢 Key Responsibilies:
1. Requirement Analysis
o Meet with users and understand what data is needed.
2. Design Tables and Relaonships
o Create a schema with tables, columns, and relaonships.
3. Normalizaon
o Avoid data duplicaon.
o Split tables properly (1NF, 2NF, 3NF, etc.)
Easy2Siksha.com
4. ER Diagram
o Create Enty-Relaonship diagrams to plan database structure.
5. Ensure Data Integrity
o Add primary keys, foreign keys to maintain relaonships.
6. Decide Data Types
o Choose correct data types for each column (e.g., INT, VARCHAR).
󹳴󹳵󹳶󹳷 Example:
In a library system, the designer creates:
BOOK(BookID, Title, Author)
MEMBER(MemberID, Name, Address)
ISSUE(BookID, MemberID, IssueDate)
They dene how these tables connect, and make sure the design is ecient and reliable.
PART (iii): Find Candidate Key of R and Jusfy
We are given:
Relaon R(A, B, C, D, E, F)
Funconal Dependencies (FDs):
1. A → C
2. D → E
3. F → B
4. E → A
5. C → E
6. B → D
We need to nd the candidate key – the minimum set of aributes that can uniquely idenfy
all other aributes.
󹻀 Step 1: Understand the Goal
We want to nd a set of aributes (lets call it X) such that:
X⁺ (closure of X) = {A, B, C, D, E, F}
Easy2Siksha.com
That means using X, and applying the funconal dependencies, we can get all aributes.
󹻀 Step 2: Analyze Dependencies
Let’s try to follow the chain of dependencies:
Starng with F:
F → B
B → D
D → E
E → A
A → C
C → E (but we already got E)
󷃆󽅕 So from F, we can reach:
F → B → D → E → A → C
󷃆󼽢 That means:
F⁺ = {F, B, D, E, A, C} = All aributes
󹻀 Step 3: F is a Candidate Key?
Yes! Since F⁺ = All aributes, and F is a single aribute, it is the candidate key.
But lets check if any smaller or dierent key is possible.
Try A:
A → C
C → E
E → A (back again), but we don't get F or B.
So A is not a candidate key.
Try E:
E → A
A → C
C → E (loop), but sll not B or F.
So E is not a candidate key.
Easy2Siksha.com
󹻀 Final Answer:
󷃆󼽢 Candidate Key: F
Because:
Starng from F, using all funconal dependencies, we can reach every aribute.
It is minimal (no smaller set than this can do the same).
2.(i) Describe the terms: Primary key, Candidate key. Foreign key and Super key.
(ii) Explain how cardinalies, roles, weak enes and weak relaons are represented in E-
R diagrams. Demonstrate the database design with E-R Model for taking example of
Student Management System.
Ans: 1. Primary Key
Denion:
A Primary Key is a column (or set of columns) in a table that uniquely idenes each row in
that table.
Key Features:
It must be unique.
It cannot be NULL.
Every table should have only one primary key.
Example:
Lets take a table called Student.
Roll_No
Name
Age
Class
101
Ramesh
18
12A
102
Suresh
19
12B
103
Mahesh
18
12A
Here, Roll_No is a primary key because:
Each student has a dierent roll number.
No roll number is repeated or NULL.
So, we can use Roll_No to uniquely idenfy each student in the database.
Easy2Siksha.com
󹻂 2. Candidate Key
Denion:
A Candidate Key is a column or a combinaon of columns that can uniquely idenfy each
row in a table. From these candidate keys, one is chosen as the Primary Key.
Key Features:
A table can have more than one candidate key.
One candidate key becomes the primary key, others are called alternate keys.
Example:
In the same Student table:
Name
Age
Class
Email
Ramesh
18
12A
ramesh@gmail.com
Suresh
19
12B
suresh@gmail.com
Mahesh
18
12A
mahesh@gmail.com
Here:
Roll_No is unique.
Email is also unique.
So, both Roll_No and Email are Candidate Keys.
You can choose either one as the Primary Key, and the other becomes an Alternate Key.
󹻂 3. Foreign Key
Denion:
A Foreign Key is a column in one table that refers to the primary key of another table. It is
used to create a relaonship between two tables.
Key Features:
It helps to connect data across tables.
It allows referenal integrity (data is consistent between related tables).
Example:
Lets say we have two tables:
Table 1: Student
Easy2Siksha.com
Roll_No
Name
Age
Class
101
Ramesh
18
12A
102
Suresh
19
12B
Table 2: Fees
Fee_ID
Roll_No
Amount
1
101
5000
2
102
4500
Here:
Roll_No in Student is the Primary Key.
Roll_No in Fees is a Foreign Key because it connects to the student.
This tells us which student has paid which fee.
󹻂 4. Super Key
Denion:
A Super Key is a column or combinaon of columns that can uniquely idenfy a row in a
table. It includes Primary Key, Candidate Keys, and any other combinaon that ensures
uniqueness.
Key Features:
It may have extra columns that are not necessary.
It is a superset of the primary key.
Example:
In the same Student table:
Roll_No
Name
Age
Class
101
Ramesh
18
12A
Some possible super keys:
Roll_No
Roll_No + Name
Easy2Siksha.com
Roll_No + Age + Class
All of them can uniquely idenfy a row, but only Roll_No is the minimal and ecient key, so
it becomes the Primary Key.
󼨐󼨑󼨒 Summary (Table Format):
Key Type
Uniqueness
NULL Allowed?
Number in a Table
Example
Primary Key
Yes
󽅂 No
1 only
Roll_No
Candidate Key
Yes
󽅂 No
1 or more
Email, Roll_No
Foreign Key
󽅂 Not required
󷃆󼽢 Yes
0 or more
Roll_No (in Fees)
Super Key
Yes
󽅂 No
Many
Roll_No+Name
Queson 2 (ii): Explain how cardinalies, roles, weak enes and weak relaons are
represented in E-R diagrams. Demonstrate the database design with E-R Model for taking
example of Student Management System.
󹻁 Understanding E-R Model in Simple Words
E-R (Enty-Relaonship) model is a diagram used in database design that shows:
Enes (things like Student, Course, Teacher)
Aributes (like Name, Age)
Relaonships (like "Enrolls", "Teaches")
󹴡󹴵󹴣󹴤 Terms in the Queson Explained:
󹻂 1. Cardinalies
Denion:
Cardinality shows how many instances of one enty relate to another enty.
There are 3 types of cardinality:
Easy2Siksha.com
One to One (1:1)
One to Many (1:N)
Many to Many (M:N)
Examples:
One student has one ID card → 1:1
One teacher teaches many students → 1:N
Many students enroll in many courses M:N
Representaon in ER Diagram:
Shown as lines with numbers or symbols near them like:
o (1,1), (0,N), etc.
󹻂 2. Roles
Denion:
When the same enty parcipates in a relaonship more than once, we dene roles to avoid
confusion.
Example:
In an Employee enty:
One employee manages another employee.
Here, both are employees but have dierent roles:
Manager
Subordinate
Representaon in ER Diagram:
Easy2Siksha.com
Label the relaonship lines with roles like “Manager” and “Subordinate”.
󹻂 3. Weak Enes
Denion:
A Weak Enty is an enty that cannot exist without another enty.
Key Features:
It does not have a primary key of its own.
It depends on a strong (owner) enty.
It has a paral key.
Example:
Let’s say:
A Student can have mulple Fee Payments.
Fee Payment cannot exist without the student.
Fee Payment is a weak enty.
Representaon in ER Diagram:
Double rectangle for weak enty.
Double diamond for weak relaonship.
Arrow poinng to the strong enty.
󹻂 4. Weak Relaonships
Denion:
A Weak Relaonship connects a weak enty to its owner enty.
Example:
Student —< Pays >— Fee
Here:
“Pays” is a weak relaonship between Student (strong) and Fee (weak).
Representaon:
Double diamond shape for the relaonship.
Line connecng weak enty to strong enty with total parcipaon (double line).
Easy2Siksha.com
󷪛󷪜󷪝󷪞󷪟󷪠󷪢󷪡 Example: Student Management System ER Model
Lets design a simple E-R Diagram using the concepts above.
󷕘󷕙󷕚 Enes:
1. Student
o Roll_No (Primary Key)
o Name
o Age
o Email
2. Course
o Course_ID (Primary Key)
o Course_Name
o Credits
3. Teacher
o Teacher_ID (Primary Key)
o Name
o Subject
4. Fee_Payment (Weak Enty)
o Receipt_No (Paral Key)
o Date
o Amount
󹹋󹹌 Relaonships:
1. Enrolls (between Student and Course)
o Many-to-Many (M:N)
2. Teaches (between Teacher and Course)
o One-to-Many (1:N) — one teacher teaches many courses.
3. Pays (between Student and Fee_Payment)
o One-to-Many (1:N)
o Weak Relaonship
Easy2Siksha.com
󹲹󹲺󹲻󹲼󹵉󹵊󹵋󹵌󹵍 Final ER Diagram (Described in Text)
Student (Enty) — aributes: Roll_No (PK), Name, Age, Email.
Course (Enty) — aributes: Course_ID (PK), Course_Name, Credits.
Teacher (Enty) — aributes: Teacher_ID (PK), Name, Subject.
Fee_Payment (Weak Enty) — aributes: Receipt_No (paral key), Date, Amount.
Relaonships:
Student ENROLLS in Course — Many-to-Many
Teacher TEACHES Course — One-to-Many
Student PAYS Fee_Payment — Weak Relaonship, One-to-Many
󹰤󹰥󹰦󹰧󹰨 Example Data:
Students Table:
Roll_No
Name
Age
Email
101
Amit
18
amit@gmail.com
102
Sumit
19
sumit@gmail.com
Courses Table:
Course_ID
Course_Name
Credits
C01
Math
4
C02
Science
3
Teachers Table:
Teacher_ID
Name
Subject
T01
Mrs. Rao
Math
T02
Mr. Khan
Science
Fee_Payment Table:
Easy2Siksha.com
Receipt_No
Date
Amount
Roll_No (FK)
R001
2025-01-15
5000
101
R002
2025-02-12
5000
102
󷃆󼽢 Conclusion:
In this explanaon, we have:
Described all four key types (Primary, Candidate, Foreign, Super) with easy examples.
Explained how important elements like cardinality, roles, weak enty, and weak
relaonships are represented in E-R diagrams.
Created a Student Management System example that shows real-world use of these
concepts
SECTION-B
3. Dene the term normalizaon and its need. Explain INF, 2NF and 3NF with suitable
examples. Also discuss the problems associated with these normal forms.
Ans: Normalizaon: Denion, Need, Types (1NF, 2NF, 3NF), and Problems – Explained
Simply
󼨐󼨑󼨒 What is Normalizaon?
In simple words:
Normalizaon is the process of organizing data in a database to reduce data redundancy
(repeang data) and improve data integrity (accuracy and consistency).
Imagine you are wring informaon about students in a notebook. If you write the same
students address or course again and again, your notebook will be big, confusing, and prone
to errors. Similarly, in databases, we use normalizaon to avoid repeon and keep the data
clean and ecient.
󷗭󷗨󷗩󷗪󷗫󷗬 Why is Normalizaon Needed?
Let’s understand this with a small example.
Easy2Siksha.com
󹺾 Without Normalizaon:
Suppose we have a table like this:
Student_ID
Name
Course
Course_Fee
Instructor
101
Ravi
B.Com
15000
Mr. Sharma
102
Aar
BCA
20000
Ms. Mehta
103
Ravi
B.Com
15000
Mr. Sharma
104
Sneha
BBA
18000
Mr. Roy
Problems:
Ravi appears twice – repeang data.
If B.Com fee changes, we have to update it in mulple places.
High chance of mistakes.
󷃆󼽢 With Normalizaon:
We divide the data into mulple related tables:
1. Student Table
2. Course Table
3. Instructor Table
This way:
Data is stored only once.
If we want to update a course fee, we do it in one place.
No repeon, beer consistency.
󷃆󹸊󹸋 Steps of Normalizaon
Normalizaon is done in steps called normal forms (NFs):
Step
Name
Goal
1
First Normal Form (1NF)
Remove repeang groups
2
Second Normal Form (2NF)
Remove paral dependency
3
Third Normal Form (3NF)
Remove transive dependency
Lets now understand each normal form in detail, one by one with examples.
Easy2Siksha.com
󼨻󼨼 1NF – First Normal Form
󽄡󽄢󽄣󽄤󽄥󽄦 Denion:
A table is in 1NF if:
All the columns have atomic (single) values.
There are no repeang groups or arrays.
󽅂 Bad Example (Not in 1NF):
Student_ID
Name
Courses
101
Ravi
B.Com, M.Com
102
Aar
BCA
Here, Courses column has mulple values. This is not atomic.
󷃆󼽢 Good Example (In 1NF):
Student_ID
Name
Course
101
Ravi
B.Com
101
Ravi
M.Com
102
Aar
BCA
Now every value is atomic (single), so it is in 1NF.
󼨸󼨹󼨺 Problem with 1NF:
Even though the table is in 1NF:
The name "Ravi" is repeated.
Course details may also repeat.
Sll redundancy is there.
So, we go to 2NF to x this.
󼨻󼨼 2NF – Second Normal Form
󽄡󽄢󽄣󽄤󽄥󽄦 Denion:
A table is in 2NF if:
It is already in 1NF.
There is no paral dependency.
Easy2Siksha.com
󹴷󹴺󹴸󹴹󹴻󹴼󹴽󹴾󹴿󹵀󹵁󹵂 What is Paral Dependency?
If a non-key aribute (like Name) depends on only part of the primary key, then it's paral
dependency.
This usually happens when the primary key is composite (made of two or more columns).
󹺾 Example (Not in 2NF):
Student_ID
Course
Name
Course_Fee
101
B.Com
Ravi
15000
102
BCA
Aar
20000
Primary Key: (Student_ID + Course)
Here:
Name depends on Student_ID only
Course_Fee depends on Course only
So, we have paral dependencies.
󷃆󼽢 Soluon (2NF):
Break the table into smaller ones:
󷕘󷕙󷕚 Student Table:
Student_ID
Name
101
Ravi
102
Aar
󹴡󹴵󹴣󹴤 Course Table:
Course
Course_Fee
B.Com
15000
BCA
20000
Easy2Siksha.com
󹲹󹲺󹲻󹲼󹵉󹵊󹵋󹵌󹵍 Enrollment Table:
Student_ID
Course
101
B.Com
102
BCA
Now:
Each aribute depends fully on the enre primary key.
No paral dependency, so it is in 2NF.
󼨻󼨼 3NF – Third Normal Form
󽄡󽄢󽄣󽄤󽄥󽄦 Denion:
A table is in 3NF if:
It is already in 2NF.
There is no transive dependency.
󹴷󹴺󹴸󹴹󹴻󹴼󹴽󹴾󹴿󹵀󹵁󹵂 What is Transive Dependency?
If A → B and B → C, then A → C is a transive dependency.
In simple terms:
One column depends on another non-key column.
Not directly on the primary key.
󹺾 Example (Not in 3NF):
Student_ID
Name
Course
Instructor_Name
Instructor_Dept
101
Ravi
B.Com
Mr. Sharma
Commerce
Here:
Student_ID → Course
Course → Instructor_Name
Instructor_Name → Instructor_Dept
So, there are transive dependencies.
Easy2Siksha.com
󷃆󼽢 Soluon (3NF):
Break it further:
󷕘󷕙󷕚 Student Table:
Student_ID
Name
101
Ravi
󹲹󹲺󹲻󹲼󹵉󹵊󹵋󹵌󹵍 Enrollment Table:
Student_ID
Course
101
B.Com
󹴡󹴵󹴣󹴤 Course Table:
Course
Instructor_Name
B.Com
Mr. Sharma
󷽰󷽱󸚌󷽲󷽳󷽴󷽵󷽶󸚍󷽷󸚎󸚏󷽸󷽹󸚐󷽺󷽻󸚑󸚒󷽼󷽽󷽾󷽿󷾀󷾁󷾂󷾃󷾄󷾅󷾆󷾇󷾈󷾉󸚓 Instructor Table:
Instructor_Name
Instructor_Dept
Mr. Sharma
Commerce
Now:
No non-key aribute depends on another non-key aribute.
All aributes depend directly on the primary key.
This is 3NF.
󼿰󼿱󼿲 Problems/Disadvantages of Normal Forms
While normalizaon helps in making the data clean and organized, it also has some
drawbacks:
1. 󽅇󽅈 Too Many Tables
You have to break your data into many small tables.
For example: student data, course data, instructor data, etc.
This makes wring SQL queries more complex.
2. 󽅇󽅈 Slower Performance for Big Joins
To get full informaon, you have to join mulple tables.
Easy2Siksha.com
For example, to know the student and their instructor's department, you may join 4
tables.
This takes more me and slows down performance.
3. 󽅇󽅈 Overhead in Design
You need good knowledge of database design.
Beginners may nd it confusing and make mistakes.
󷃆󼽢 When to Normalize?
Use normalizaon:
When data repeats a lot.
When you want to avoid update problems.
When you need data accuracy and integrity.
But in real projects, somemes we also use denormalizaon (combining some tables) for
speed and performance.
󷃆󼽢 Summary Table: Normal Forms
Normal Form
Goal
Problem Fixed
1NF
Atomic data only
Removes mul-valued aributes
2NF
No paral dependency
Removes repeon for part keys
3NF
No transive dependency
Removes indirect dependencies
󼨐󼨑󼨒 Final Thoughts (From a Students View)
Think of normalizaon as cleaning your notebook – instead of wring things again
and again, you make tables and references.
Start with 1NF → then 2NF → then 3NF — step-by-step.
It makes your data smaller, neater, and easier to update.
Learn with examples, draw tables yourself, and pracce to become condent.
Easy2Siksha.com
4. Explain various database models along with their advantages and disadvantages.
Ans: Introducon (Story Style)
Imagine you’re the manager of a big library. This library has thousands of books. You also
have members who borrow books, and employees who manage them. Now, you want to
store all this informaon in a way thats easy to manage, search, and update.
You could write it in a notebook (tradional way), but that's messy. So, you decide to use a
Database Management System (DBMS).
But here comes the twist — there are dierent types of database models just like dierent
ways to organize your library:
By category (con, science, history)
By author name
By shelf number
Each method has its own pros and cons.
In the world of databases, we call these ways "Database Models" — dierent methods to
store and organize data.
Lets explore the most popular database models like a story, one by one, with examples and
their good and bad sides.
1. Hierarchical Database Model
󹴮󹴯󹴰󹴱󹴲󹴳 Story:
Imagine your library keeps informaon like a family tree:
At the top, you have Main Category (e.g., Science)
Under that, you have Sub Category (e.g., Physics)
Then, you have Books
And under Books, you may have Chapters
So, the structure looks like:
Science → Physics → Book: “Concepts of Physics” → Chapter 1
Each item has only one parent, just like in a tree.
󷃆󼽢 Advantages:
Fast access: Because its like a direct path (like a tree), searching is fast.
Easy2Siksha.com
Simple structure: Easy to understand and manage when data follows a hierarchy.
󽅂 Disadvantages:
No exibility: You can’t link a book to two categories (e.g., Physics and Math).
Dicult to change: If you want to add a new layer, you have to redesign everything.
2. Network Database Model
󹴮󹴯󹴰󹴱󹴲󹴳 Story:
Now, what if a book belongs to both Physics and Mathemacs?
Hierarchical model can’t handle that. So, your library uses the Network Model, where a book
can belong to many categories, and a category can have many books. It's like a web.
So instead of a tree, its a graph with mulple connecons.
󷃆󼽢 Advantages:
Many-to-many relaonships: A book can belong to mulple subjects.
Faster access for complex data: Beer for data thats connected in many ways.
󽅂 Disadvantages:
Complex design: It's like a messy web — hard to manage and understand.
Dicult to update: Adding new data requires many changes.
3. Relaonal Database Model (Most Popular)
󹴮󹴯󹴰󹴱󹴲󹴳 Story:
Lets say now you decide to organize your library with tables, just like in Excel.
You have:
A table for Books
A table for Members
A table for Borrow Records
Each table has rows and columns.
For example:
Easy2Siksha.com
Books Table
BookID
Title
Author
Category
1
Concepts of Physics
HC Verma
Physics
Members Table
MemberID
Name
Phone Number
101
Rohan
9876543210
You can link these tables using keys (e.g., BookID, MemberID).
This model is the most commonly used today (MySQL, Oracle, etc.)
󷃆󼽢 Advantages:
Simple and organized: Uses rows and columns.
Flexible and powerful: Can handle huge data.
Easily searchable: Use SQL (Structured Query Language).
Data integrity: You can set rules so wrong data doesn’t get saved.
󽅂 Disadvantages:
Slower for very complex queries.
Needs expert knowledge to design relaonships and write queries.
Doesn’t handle very big connected data well, like social media connecons.
4. Object-Oriented Database Model
󹴮󹴯󹴰󹴱󹴲󹴳 Story:
Now, your library wants to store not just books, but also videos, audio les, and 3D models.
These items are not just data — they are objects with features (called properes) and
acons (called methods).
For example:
A “Book” object has: Title, Author, ISBN
A “Video” object has: Title, Duraon, Resoluon
This is like Object-Oriented Programming (OOP).
Easy2Siksha.com
This model stores data in the form of objects — just like real-world enes.
󷃆󼽢 Advantages:
Can handle mulmedia: Video, audio, graphics.
Good for complex applicaons: Like gaming, 3D modeling, simulaons.
Encapsulaon: Keeps data and operaons together.
󽅂 Disadvantages:
Not suitable for simple data
Slower performance than relaonal databases in basic applicaons.
Less popular, so fewer developers know it.
5. Document Database Model (NoSQL)
󹴮󹴯󹴰󹴱󹴲󹴳 Story:
Lets say you start a digital library app where each book entry is like a document — in JSON
format.
Example:
{
"tle": "Concepts of Physics",
"author": "HC Verma",
"category": "Physics",
"year": 2010
}
Every book has its own document. It doesn’t follow strict rows and columns.
This model is used by NoSQL databases like MongoDB.
󷃆󼽢 Advantages:
Flexible: No xed structure; each document can be dierent.
Scalable: Works well with huge data (big data, real-me apps).
Fast performance: Especially for reading data.
Easy2Siksha.com
󽅂 Disadvantages:
No standard rules: So, it can become messy.
No strong relaonships like relaonal databases.
Hard to validate data if the structure keeps changing.
6. Key-Value Database Model
󹴮󹴯󹴰󹴱󹴲󹴳 Story:
You now run a mini online bookshop. You want to store quick details like:
"book101" → "Concepts of Physics"
"book102" → "Organic Chemistry"
Its like a diconary: each item has a key and a value.
Used in caching, session management, and real-me apps. (e.g., Redis, DynamoDB)
󷃆󼽢 Advantages:
Super fast data retrieval.
Simple structure.
Great for search engines, online stores, etc.
󽅂 Disadvantages:
No relaonships between data.
Limited use: Not good for complex queries.
󹴷󹴺󹴸󹴹󹴻󹴼󹴽󹴾󹴿󹵀󹵁󹵂 Summary Table
Model
Structure Type
Best Use
Pros
Cons
Hierarchical
Tree
Organizaon
charts, le systems
Fast, Simple
Rigid, No many-
to-many links
Network
Graph
Telecom, Airlines
Flexible, Fast
Complex structure
Relaonal
Table (Rows &
Columns)
Business, Apps,
Banking
Popular,
Reliable
Needs design &
SQL skills
Easy2Siksha.com
Object-
Oriented
Objects (OOP)
Mulmedia,
Games
Real-world
modeling
Less common,
slower
Document
(NoSQL)
JSON
Documents
Big data, Web apps
Scalable,
Flexible
No strict rules
Key-Value
(NoSQL)
Diconary (Key
→ Value)
Caching, Shopping
carts
Fast, Simple
No relaonships
SECTION-C
5. Consider the following schemas:
Student (sid: Integer, Firstname: string, lastname: string, age: Integer)
(i) Explain the use of logical operators using some SQL queries.
(ii) List various aggregaon funcons. Write SQL queries to implement aggregate
funcons.
Ans: 󼨐󼨑󼨒 PART (i): Use of Logical Operators in SQL (with Examples)
Lets imagine you are a college student and you’re working on the college’s student
database. You are using SQL to get specic informaon from the Student table.
󼨻󼨼 What are Logical Operators?
Logical operators are used in SQL to combine condions. They help you lter results based
on more than one condion.
There are three main logical operators in SQL:
1. AND
2. OR
3. NOT
󷗭󷗨󷗩󷗪󷗫󷗬 Example Table: Student
Let’s take a small sample of data from our Student table:
sid
rstname
lastname
age
1
Rahul
Sharma
20
2
Simran
Kaur
22
Easy2Siksha.com
3
Aman
Gupta
21
4
Riya
Verma
19
5
Aman
Singh
22
Now let’s use logical operators to answer some common queries:
󷃆󼽢 1. AND Operator
Story: You want to nd students whose name is Aman and who are 22 years old.
SELECT * FROM Student
WHERE rstname = 'Aman' AND age = 22;
󷃆󼽢 Output:
sid
rstname
lastname
age
5
Aman
Singh
22
Explanaon: Only one student matches both condions: rstname is Aman and age is 22.
󷃆󼽢 2. OR Operator
Story: You want to nd students who are either 20 years old or named Simran.
SELECT * FROM Student
WHERE age = 20 OR rstname = 'Simran';
󷃆󼽢 Output:
sid
rstname
lastname
age
1
Rahul
Sharma
20
2
Simran
Kaur
22
Explanaon: Rahul is 20, and Simran’s name matches. So both are selected using OR.
󷃆󼽢 3. NOT Operator
Story: You want to nd all students who are not 22 years old.
Easy2Siksha.com
SELECT * FROM Student
WHERE NOT age = 22;
󷃆󼽢 Output:
sid
rstname
lastname
age
1
Rahul
Sharma
20
3
Aman
Gupta
21
4
Riya
Verma
19
Explanaon: NOT simply reverses the condion. All students who are not 22 are shown.
󷃆󼽢 Combining Logical Operators
Story: You want to nd students who are named Aman and are not 22 years old.
SELECT * FROM Student
WHERE rstname = 'Aman' AND NOT age = 22;
󷃆󼽢 Output:
sid
rstname
lastname
age
3
Aman
Gupta
21
Explanaon: Aman is matched, but only if his age is not 22.
󼨐󼨑󼨒 Tip:
You can also use brackets to control the priority:
SELECT * FROM Student
WHERE (rstname = 'Aman' OR rstname = 'Riya') AND age < 22;
This selects all Aman and Riya students who are younger than 22.
󹳨󹳤󹳩󹳪󹳫 PART (ii): Aggregaon Funcons in SQL (with Examples)
Now let’s move to the second part.
󹳴󹳵󹳶󹳷 What are Aggregaon Funcons?
Easy2Siksha.com
Aggregaon funcons process mulple rows and return one value (like a total or average).
Think of them like Excel formulas that summarize data.
󹺁󹺂 Common Aggregaon Funcons:
1. COUNT() – Counts how many rows
2. SUM() – Adds up the total
3. AVG() – Finds the average
4. MIN() – Finds the minimum value
5. MAX() – Finds the maximum value
Let’s connue with our Student table:
sid
rstname
lastname
age
1
Rahul
Sharma
20
2
Simran
Kaur
22
3
Aman
Gupta
21
4
Riya
Verma
19
5
Aman
Singh
22
󷃆󼽢 1. COUNT()
Story: You want to know how many students are in the table.
SELECT COUNT(*) AS total_students FROM Student;
󷃆󼽢 Output:
total_students
5
󷃆󼽢 2. SUM()
Story: You want to know the total of all students' ages.
SELECT SUM(age) AS total_age FROM Student;
󷃆󼽢 Output:
Easy2Siksha.com
total_age
104
(20 + 22 + 21 + 19 + 22 = 104)
󷃆󼽢 3. AVG()
Story: You want to know the average age of students.
SELECT AVG(age) AS average_age FROM Student;
󷃆󼽢 Output:
average_age
20.8
(104 / 5 = 20.8)
󷃆󼽢 4. MIN()
Story: You want to know the youngest student's age.
SELECT MIN(age) AS youngest_age FROM Student;
󷃆󼽢 Output:
youngest_age
19
󷃆󼽢 5. MAX()
Story: You want to know the oldest student's age.
SELECT MAX(age) AS oldest_age FROM Student;
󷃆󼽢 Output:
oldest_age
22
Easy2Siksha.com
󷃆󼽢 Grouping with Aggregaon (GROUP BY)
Story: You want to know how many students are there for each age.
SELECT age, COUNT(*) AS number_of_students
FROM Student
GROUP BY age;
󷃆󼽢 Output:
age
number_of_students
19
1
20
1
21
1
22
2
Explanaon: There are 2 students aged 22, and one each for the other ages.
󷃆󼽢 Summary of the Answer:
󹸯󹸭󹸮 Logical Operators Recap:
AND: both condions must be true
OR: at least one condion must be true
NOT: reverses a condion
󼩕󼩖󼩗󼩘󼩙󼩚 Aggregaon Funcons Recap:
COUNT() – Count of rows
SUM() – Total of a column
AVG() – Average value
MIN() – Smallest value
MAX() – Largest value
Easy2Siksha.com
6. What do you understand by a query language? Name various query language based on
Tuple and domain calculus. What are the dierent types of JOINs in SQL?
Explain with example.
Ans: Imagine this as a Story:
Lets say you are in college and you have a library database. This database contains tables
like:
1. Students (Student_ID, Name, Department)
2. Books (Book_ID, Title, Author)
3. Issued_Books (Student_ID, Book_ID, Issue_Date)
Now, you want to ask quesons to this database like:
Which students have borrowed books?
What are the names of books issued by students from the Commerce department?
To ask such quesons from a database, you need a language that the database understands.
That language is called a Query Language.
󷆰 1. What is a Query Language?
A Query Language is a special computer language used to communicate with a database.
Using it, you can:
Retrieve data (e.g., show all books)
Insert data (e.g., add a new student)
Delete data (e.g., remove old records)
Update data (e.g., change book tle)
The most common query language is SQL (Structured Query Language).
󹴡󹴵󹴣󹴤 2. Types of Query Languages Based on Tuple and Domain Calculus
There are some theorecal query languages too. They are not used like SQL in daily work but
are important in understanding how databases work internally.
These are:
A. Tuple Relaonal Calculus (TRC)
Here, we work with enre rows (tuples).
We ask: “Give me all rows that sasfy a certain condion.
Easy2Siksha.com
󽄬󽄭󽄮󽄯󽄰 Example:
Lets say you want to nd all students from the Commerce department.
In Tuple Relaonal Calculus, it looks like:
{ t | t Students AND t.Department = 'Commerce' }
It means: return all tuples t from the Students table where department = Commerce.
B. Domain Relaonal Calculus (DRC)
Here, we work with individual column values (domains) instead of whole rows.
󽄬󽄭󽄮󽄯󽄰 Example:
Lets say you want the names of students from Commerce.
In Domain Relaonal Calculus:
{ Name | ID Dept (Students(ID, Name, Dept) AND Dept = 'Commerce') }
It means: return the Name where there exists an ID and Department such that the student is
from Commerce.
󹹋󹹌 3. What are the Dierent Types of JOINs in SQL?
Now let’s move to something very praccal — JOINs in SQL.
When you have data in two or more tables, and you want to combine them, you use JOIN.
Imagine this:
The Students table has names of students.
The Issued_Books table has only Student_IDs and Book_IDs.
If you want to nd the names of students who borrowed books, you need to join these two
tables.
A. INNER JOIN
Returns only the matching rows between two tables.
󼪺󼪻 Example:
SELECT Students.Name, Issued_Books.Book_ID
FROM Students
INNER JOIN Issued_Books
Easy2Siksha.com
ON Students.Student_ID = Issued_Books.Student_ID;
󹰤󹰥󹰦󹰧󹰨 This will give only those students who have issued books.
B. LEFT JOIN (or LEFT OUTER JOIN)
Returns all rows from the le table, even if there is no match in the right table.
If there’s no match, it lls with NULL.
󼪺󼪻 Example:
SELECT Students.Name, Issued_Books.Book_ID
FROM Students
LEFT JOIN Issued_Books
ON Students.Student_ID = Issued_Books.Student_ID;
󹰤󹰥󹰦󹰧󹰨 This will show all students, whether or not they have issued any books.
C. RIGHT JOIN (or RIGHT OUTER JOIN)
Similar to LEFT JOIN, but keeps all records from the right table.
󼪺󼪻 Example:
SELECT Students.Name, Issued_Books.Book_ID
FROM Students
RIGHT JOIN Issued_Books
ON Students.Student_ID = Issued_Books.Student_ID;
󹰤󹰥󹰦󹰧󹰨 This will show all issued books, even if a student record is missing.
D. FULL JOIN (or FULL OUTER JOIN)
Combines both LEFT and RIGHT JOIN.
Shows all records from both tables with NULLs where there is no match.
󼪺󼪻 Example:
SELECT Students.Name, Issued_Books.Book_ID
FROM Students
FULL JOIN Issued_Books
Easy2Siksha.com
ON Students.Student_ID = Issued_Books.Student_ID;
󹰤󹰥󹰦󹰧󹰨 This gives a complete picture — all students and all issued books, even if one side is
missing data.
󹳴󹳵󹳶󹳷 Summary (In Simple Points)
Concept
Simple Meaning
Query Language
A language to ask quesons to the database
TRC
Use full rows (tuples) to lter data
DRC
Use individual column values (domains)
INNER JOIN
Only matched records
LEFT JOIN
All records from le + matched right
RIGHT JOIN
All records from right + matched le
FULL JOIN
All records from both tables
󼨐󼨑󼨒 Real-Life Analogy
Think of a JOIN like combining two pages from dierent notebooks:
INNER JOIN: Only lines that match in both notebooks.
LEFT JOIN: All lines from the rst notebook, matched lines from second.
RIGHT JOIN: All lines from second notebook, matched lines from rst.
FULL JOIN: All lines from both notebooks.
SECTION-D
7. List various Concurrency Control and Management Mechanisms used in DBMS. Explain
in detail the working of 2PL protocol.
Ans: What is Concurrency Control in DBMS?
Imagine a library where many students are reading and borrowing books at the same me.
What if two students want the same book at the same me? Or one student wants to return
a book while another is trying to borrow it?
Easy2Siksha.com
Similarly, in a Database Management System (DBMS), many users (or programs) may try to
access or change the same data at the same me. This can create problems, such as:
One user overwring anothers changes
Reading incorrect or old data
Data inconsistency
To avoid such problems, DBMS uses Concurrency Control mechanisms. These mechanisms
manage mulple transacons (like students trying to read/write data) in such a way that the
database remains accurate and consistent.
󹳬󹳭󹳮󹳯󹳰󹳳󹳱󹳲 Types of Concurrency Control Mechanisms
Lets now list and explain the various types of concurrency control methods used in DBMS:
1. Lock-Based Protocols
These use locks to control access to data items.
When one transacon locks a data item, others must wait.
Example: Two students can’t borrow the same book if one has already locked it.
Types:
Shared Lock (S-lock): for reading
Exclusive Lock (X-lock): for wring
2. Timestamp-Based Protocols
Every transacon is given a mestamp when it starts.
Transacons follow the mestamp order to read/write data.
Older transacons get priority.
Example: Like students taking turns in the order they arrived at the library.
3. Validaon-Based Protocols (Opmisc Concurrency Control)
Transacons execute without restricons but are validated before commit.
If validaon fails, the transacon is rolled back.
Example: Like students wring notes, but before subming, the teacher checks for
any conict.
4. Mulversion Concurrency Control (MVCC)
Maintains mulple versions of data.
Easy2Siksha.com
Readers see the version they started with, while writers create new versions.
Example: Like students reading the rst edion of a book while someone else is
wring the second edion.
5. Two-Phase Locking Protocol (2PL)
This is a very important and widely used method.
It ensures serializability (meaning transacons happen in a logical order).
Lets explain this one in detail with a story.
󹴮󹴯󹴰󹴱󹴲󹴳 Detailed Story-Based Explanaon of 2PL (Two-Phase Locking Protocol)
Lets say you and your friend Rahul are doing a group project using a shared notebook (the
database).
Scenario:
You both want to:
Read some pages
Write some new informaon
But to avoid messing up each others work, your teacher makes a rule called Two-Phase
Locking (2PL).
This rule has two phases:
󽄬󽄭󽄮󽄯󽄰 Phase 1: Growing Phase (Locking Phase)
You can take as many locks as you want (to read or write pages).
BUT: You are not allowed to release any lock in this phase.
Example:
You say, “I want to read Page 3” → You lock Page 3
Then you say, “I want to write on Page 5” → You lock Page 5
You keep adding locks…
󹸾󹸿󹹀 Phase 2: Shrinking Phase (Unlocking Phase)
Once you release any one lock, you cannot take any more locks.
You can now only release the rest of your locks.
Easy2Siksha.com
Example:
You release the lock on Page 3 → Now you are in the shrinking phase
You can no longer lock any new page
You just nish and release your remaining locks
Why is this rule useful?
This rule makes sure that no two people change the same page at the same me, and no
one reads wrong or half-wrien data.
Lets take a full example with transacons:
󼪺󼪻 Example of 2PL with Transacons
Imagine two transacons:
T1: Transfer ₹100 from Account A to B
T2: Calculate total balance of Account A + B
Without 2PL:
T1 reads A = ₹1000
T1 subtracts ₹100 → A = ₹900
T2 reads A = ₹900
T1 adds ₹100 to B → B = ₹1100
T2 reads B = ₹1100
T2 shows total = ₹2000 → 󽅂 Wrong (should be ₹2100)
With 2PL:
T1:
Lock A (X-lock)
Read A = ₹1000
A = A - 100
Lock B (X-lock)
Read B = ₹1000
B = B + 100
Write A = ₹900
Easy2Siksha.com
Write B = ₹1100
Release locks on A and B
T2:
Waits for T1 to release locks
Then reads A = ₹900, B = ₹1100
Total = ₹2000 󷃆󼽢 Correct
But 2PL ensures that T2 waits and reads the data only aer T1 nishes properly, prevenng
inconsistency.
󼨐󼨑󼨒 Summary of 2PL Rules
Growing Phase = take locks only, no release
Shrinking Phase = release locks only, no new locks
Once a lock is released, the transacon can’t take any new lock
This ensures serializability and prevents conicts like lost updates or dirty reads
󷃆󼽢 Advantages of 2PL
Ensures correct and consistent results
Avoids problems like:
o Lost updates
o Dirty reads
o Unrepeatable reads
Guarantees serializability (like doing transacons in a xed, safe order)
󼿰󼿱󼿲 Disadvantages of 2PL
Can cause deadlocks: when two transacons wait for each others locks forever
Can reduce performance if too many transacons are waing
But DBMS uses deadlock detecon or prevenon techniques to solve this problem.
󷙎󷙐󷙏 Final Words
Easy2Siksha.com
In simple words, concurrency control in DBMS is like managing many students using the
same notebook without disturbing each other. 2PL is one of the best rules for making sure
everyone gets correct and fair access.
8. Write detailed notes on the following:
(i).(Big data)
(ii).Database recovery mechanisms
Ans: (i) Big Data
Imagine This…
Lets say you and your friends run a photography business. Every me you cover an event,
you take hundreds of photos, shoot videos, record audio, and even note customer reviews
on your website or social media.
Aer a few months, you realize you have:
Thousands of photos
Gigabytes of videos
Comments from hundreds of clients
Details of payments and mings
Likes, shares, and messages from social media
Now all of this data is useful! But there’s too much of it, and it keeps increasing every day.
This, in simple terms, is Big Data.
󹴡󹴵󹴣󹴤 What is Big Data?
Big Data refers to extremely large volumes of data that are too complex to be handled by
tradional database systems.
Its not just about quanty, but also about how fast it is created, how dierent it is, and how
useful it can be.
󹴂󹴃󹴄󹴅󹴉󹴊󹴆󹴋󹴇󹴈 The 5 Vs of Big Data
To understand Big Data beer, lets learn the 5 Vs — like 5 characters in a movie:
1. Volume – Big size
Example: Facebook processes petabytes of data daily.
Easy2Siksha.com
2. Velocity – Fast speed
Example: YouTube gets thousands of new videos every minute.
3. Variety – Dierent types
Example: Text, images, videos, voice messages, GPS locaons.
4. Veracity – Trustworthiness
Example: Is the review a real customer or a bot?
5. Value – Useful insights
Example: Amazon uses data to suggest products you may like.
󼨽󼨾󼨿󼩁󼩀 Simple Example: Hospital Story
Imagine a big hospital.
Every day it collects data from:
Paent records
Doctor notes
MRI and X-ray images
Medicine orders
Payments
CCTV footage
Emergency alerts
All this comes in dierent forms and is collected connuously. The hospital uses Big Data
technologies to:
Track which medicine is used most
Know which doctor is treang whom
Alert when a paent’s heartbeat is irregular
Predict disease outbreaks
This is how Big Data helps in real life.
󼩣󼩤󼩥󼩦󼩧󼩨󼩩 Tools Used for Big Data
Big Data is not managed using normal soware like MS Excel. Instead, we use:
Hadoop – Stores big data in distributed form
Spark – Fast data processing engine
Easy2Siksha.com
MongoDB – Stores unstructured data like images or videos
Kaa Handles data in moon (live data)
󹰤󹰥󹰦󹰧󹰨 Importance of Big Data
Helps companies make beer decisions
(e.g. YouTube recommends videos based on what you watch)
Saves me and cost
(e.g. Google Maps avoids trac using real-me data)
Improves health, educaon, and services
(e.g. Hospitals predicng paent risks)
󹲨󹲭󹲩󹲪󹲫󹲬 (ii) Database Recovery Mechanisms
󼨐󼨑󼨒 Imagine This...
You're working on a class project, typing your report on your computer. Aer working for 3
hours, the power goes out, and you forgot to save the le. 󺆇󺆄󺆈󺆅󺆆
But wait — MS Word has Auto-recovery, and when you turn the laptop back on, it recovers
your work. Phew!
Thats a simple version of what database recovery means in the computer world.
󹴡󹴵󹴣󹴤 What is Database Recovery?
Database recovery is the process of restoring a database to a correct state aer a failure —
like a crash, system error, or mistake.
It ensures that no data is lost and everything remains accurate and consistent.
󼿝󼿞󼿟 Types of Failures
Lets meet some "villains" of the story — the types of failures:
1. System Crash – Server shuts down due to power failure.
2. Transacon Failure – A single operaon (like updang a bank account) fails due to
some error.
3. Media Failure – Hard disk or storage fails.
4. Applicaon Error – Human error, like deleng the wrong le.
Easy2Siksha.com
󷃆󹸃󹸄 Why Recovery is Needed?
Imagine you transferred ₹5,000 from your account to your friend’s account. If the database
crashes aer debing your account but before creding your friend, then money is lost! 󽅂
So, recovery ensures:
No money is lost
Database remains consistent
All operaons complete fully or not at all
󼩣󼩤󼩥󼩦󼩧󼩨󼩩 Recovery Techniques (With Examples)
1. Log-Based Recovery
Think of it like a diary that notes every step the database performs.
Before any change, the database writes it to a log le.
If the system crashes, the log helps replay the acons to restore data.
Example:
If you change a student's marks from 70 to 80, the log writes:
Before: 70
Aer: 80
If the system fails, it reads the log and redoes or undoes the step.
2. Checkpoints
Checkpoints are like save points in a video game.
Every few minutes, the system saves the current state of the database.
If it crashes, it starts recovery from the last checkpoint instead of starng from zero.
Example:
You play a game for 2 hours but save it aer 1 hour. If the game crashes, you restart from the
save point, not from the beginning.
3. Shadow Paging
This is like creang a copy before making changes.
When a change is made, it’s done on a shadow (duplicate) page.
If the transacon is successful, the duplicate replaces the original.
Easy2Siksha.com
Example:
You're eding a photo. Before changing it, you save the original le. If eding fails, you can
sll use the backup copy.
4. Rollback & Rollforward
Rollback – Undo changes of failed transacons
Rollforward – Reapply changes from logs to reach the latest state
Example:
If a transacon is interrupted, rollback puts the database back to its original state.
Rollforward uses logs to catch up aer a crash.
󹸾󹸿󹹀 ACID Properes and Recovery
Good databases follow ACID rules, which are important for recovery:
A – Atomicity: All or nothing
C – Consistency: Data must be correct
I – Isolaon: Transacons don’t aect each other
D – Durability: Once saved, data stays even aer crash
Recovery ensures that these rules are followed, especially Atomicity and Durability.
󼨐󼨑󼨒 Summary (Easy-to-Remember Table)
Topic
Big Data
Database Recovery
Meaning
Large, complex data sets
Restoring database aer failure
Examples
Facebook data, YouTube
videos
Bank transacon crash, system failure
Main Challenge
Storage, processing, analysis
Data loss, incorrect transacons
Key
Techniques/Tools
Hadoop, Spark, MongoDB
Logs, Checkpoints, Rollback, Shadow
Paging
Goal
Gain insights, make decisions
Maintain accuracy, avoid data loss
This paper has been carefully prepared for educaonal purposes. If you noce any mistakes or have
suggesons, feel free to share your feedback.